import gl.java.game.GameEngine;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

@Slf4j
/**
 * 描述炸弹爆炸影响
 */
public class BombEffect {
    private transient final Map map;

    public interface BombListener {
        void onBomb(BombEffect bombEffect);
    }

    public List<Position> destroyList;
    public List<Bomb> bombingList;
    public List<Position> effectList;
    public List<Prop> beFoundPropList;
    public List<Player> deadPlayerList;//死亡的玩家
    public List<Prop> deadPropList;//死亡的道具

    public BombEffect(Map map) {
        this.map = map;
        destroyList = new ArrayList<>();
        bombingList = new ArrayList<>();
        effectList = new ArrayList<>();
        beFoundPropList = new ArrayList<>();
        deadPlayerList = new ArrayList<>();
        deadPropList = new ArrayList<>();
    }

    public void bombed() {
        //移除被引爆的炸弹的定时器
        for (int i = 0; i < bombingList.size(); i++) {
            Position p = bombingList.get(i);
            map.removeBomb(p.x, p.y);
        }
    }

}
